﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TeamUpdates.aspx.cs" Inherits="P.InOut.NetMvc.Components.UpdatesComponent.Views.TeamUpdates" %>
<%@ Import Namespace="P.InOut.NetMvc.Models" %>
<%@ Import Namespace="P.InOut.NetMvc.Common" %>

<!-- // List the updates for each Member in the ViewData -->
<ul id="members">
    <% foreach (MemberUpdates memberUpdates in ViewData.Model.MemberUpdates) { %>
        
        <!-- // List Member UserName -->
        <li id='<%= memberUpdates.User.Aspnet_User.UserName %>'>
            <span class="teamMemberName"><%= Html.ActionLink(
                                            memberUpdates.User.Profile.FirstName == null ||
                                            memberUpdates.User.Profile.FirstName == string.Empty ? 
                                            memberUpdates.User.Aspnet_User.UserName : 
                                            memberUpdates.User.Profile.FirstName + " " 
                                            + memberUpdates.User.Profile.LastName, 
                                            "Detail", "Updates", new { id = memberUpdates.User.UserId }) %> </span>
            - <span id='<%= memberUpdates.User.Aspnet_User.UserName %>Elapsed' class="teamStatusElapsed">▲ <%= Utilities.GetTimeElapsed(memberUpdates.User.Profile.DateTimeLastUpdated) %></span>
        </li>
        
        <li id='<%= memberUpdates.User.Aspnet_User.UserName %>Status' class="teamMemberStatus">
            <%= memberUpdates.User.Profile.Status %>
        </li>
        
            <% if (memberUpdates.User.Profile.InStatus) { %>
                
                <% if (memberUpdates.User.Profile.OfficeStatus) { %>
                    <li id='<%= memberUpdates.User.Aspnet_User.UserName %>InOutStatus' class="inOffice">
                        <span style="padding-left: 1em;">In the Office</span>
                    </li>
                
                <% } else { %>
                    <li id='<%= memberUpdates.User.Aspnet_User.UserName %>InOutStatus' class="inRemote">
                        <span style="padding-left: 1em;">In, Working Remotely</span>
                    </li>
                
                <% } %>
                
            <% } else { %>
                <li id='<%= memberUpdates.User.Aspnet_User.UserName %>InOutStatus' class="out">
                    <span style="padding-left: 1em;">Out</span>
                </li>
            
            <% } %>
            
            <% if (memberUpdates.User.Profile.InStatus) { %>
                
                <% if (memberUpdates.User.Profile.OfficeStatus) { %>
                    <li id='<%= memberUpdates.User.Aspnet_User.UserName %>Contact' class="officePhone">
                        <span style="padding-left: 1em;">Contact Me @ </span>
                        <span style="font-weight: bolder;"><%= memberUpdates.User.Profile.OfficePhone %></span>
                    </li>
                <% } else { %>
                    <li id='<%= memberUpdates.User.Aspnet_User.UserName %>Contact' class="remotePhone">
                        <span style="padding-left: 1em;">Contact Me @ </span>
                        <span style="font-weight: bolder;"><%= memberUpdates.User.Profile.RemotePhone %></span>
                    </li>
                <% } %>
                
            <% } else { %>
                <li id='<%= memberUpdates.User.Aspnet_User.UserName %>Contact' class="remotePhone">
                    <span style="padding-left: 1em;">Contact Me @ </span>
                    <span style="font-weight: bolder;"><%= memberUpdates.User.Profile.RemotePhone %></span>
                </li>
            <% } %>
        
        <li class="memberUpdatesWrapper">
            <!-- // ForEach Member list all Updates -->
            <ul id='<%= memberUpdates.User.Aspnet_User.UserName %>Updates'>
                <% foreach (Update update in memberUpdates.Updates)
                   { %>
                    
                    <li id='<%= update.Id %>MemberUpdate' class="memberUpdate">
                        <%= P.InOut.NetMvc.Common.Utilities.FormatText(update.UpdateText) %>
                    </li>
                
                <% } %>
            </ul>
        </li>
        
    <% } %>
</ul>